package com.yoga.app.web;

import com.yoga.app.annotation.LoginUser;
import com.yoga.common.appexception.AppException;
import com.yoga.common.appexception.YogaResult;
import com.yoga.common.bo.NoticeMessageBO;
import com.yoga.common.bo.YogaUserBO;
import com.yoga.common.page.PageBO;
import com.yoga.common.qto.NoticeMessageQTO;
import com.yoga.manager.admin.AdminNoticeMessageManager;
import com.yoga.manager.app.AppNoticeMessageManager;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * Created by hdx on 2020/10/19.
 */
@RestController
@RequestMapping("${basePath}")
public class AppNoticeMessageController {

    @Resource
    private AppNoticeMessageManager messageManager;

    @PostMapping("/message/findByQTO")
    public YogaResult<PageBO<NoticeMessageBO>> findByQTO(@LoginUser YogaUserBO userBO, NoticeMessageQTO messageQTO) throws AppException {
        PageBO<NoticeMessageBO> result = messageManager.findForPage(messageQTO);

        return new YogaResult<>(result);
    }



}
